package com.xhdx.pattern.composite;

import java.util.ArrayList;
import java.util.List;
/**
 * 创建一个组合模型类
 *
 */
public class Folder {
    private String name;// 名称
    private int depth;// 深度
    private String createDate;// 创建日期
    private List<Folder> folderList;

    public Folder(String name, int depth, String createDate) {
        this.name = name;
        this.depth = depth;
        this.createDate = createDate;
        folderList = new ArrayList<Folder>();
    }

    public void add(Folder e) {
        folderList.add(e);
    }

    public void remove(Folder e) {
        folderList.remove(e);
    }

    public List<Folder> getFolderList() {
        return folderList;
    }

    public String toString() {
        return ("Folder :[ Name : " + name + ", depth : " + depth + ", createDate :" + createDate + " ]");
    }
}
